package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1MonsterInstance;
import com.lineage.server.model.L1Character;

public class S_MoveNpcPacket extends ServerBasePacket {
  private byte[] _byte;
  
  public S_MoveNpcPacket(L1MonsterInstance npc, int x, int y, int heading) {
    this._byte = null;
    writeC(10);
    writeD(npc.getId());
    writeH(x);
    writeH(y);
    writeC(heading);
    writeC(128);
  }
  
  public S_MoveNpcPacket(L1Character cha) {
    this._byte = null;
    writeC(10);
    writeD(cha.getId());
    writeH(cha.getX());
    writeH(cha.getY());
    writeC(cha.getHeading());
    writeC(128);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
